Process Platform Authentication Plug-in |
The cordys.authentication plug-in handles authentications for connecting to a Process Platform server. It also contains API to retrieve the current user and organization details.The plugin supports the following types of authentications
- Web server-based authentication (Windows Authentication or Basic Authentication).
- Process Platform Single Sign-On authentication.
- OTDS (OpenTex Directory Service) based authentication.
Properties
Property | Description |
---|---|
preferredLoginURL | This property is used for setting user specific Login URL which will be used for showing login page in your application, If this property is not set then default Login URL will be used for showing Login page note: 1) If you are using this property then you should authenticate the user in your login page, 2) If the login page is opened from middle of some page then we will pass the old page "path" and "search" values as URL parameters which can be used for re-directing to the page from which Login page is opened once the user is successfully authenticated |
Examples
The following are the sample code snippets which shows usage of preferredLoginURL:
/* Code to be inserted in your application */ $.cordys.authentication.defaults.preferredLoginURL = "/cordys/html5/myPreferredLogin.htm"; /* Sample Code used to authenticate the user, below function will be called on click of submit button in myPreferredLogin.htm file */ function login() { $.cordys.authentication.sso.authenticate($("#inputName").val(), $("#inputPassword").val()).done(function(){ window.location.href = decodeURIComponent($.cordys.getURLParameter(window.location.href,"path")+$.cordys.getURLParameter(window.location.href,"search")); }); }
Methods
The following methods are supported by the cordys.authentication plug-in:
Table 1. List of Methods
Method | Description |
---|---|
getUser() | This method returns a jQuery deferred which will provide the detail of the current user and organization when resolved. It will return back the user object with the following properties.
|
login() | This method will initiate the login process. Redirect to the login page which can be configured with the loginURL property. If no loginURL is configured, it will be redirected to the default log in page. The method will return a deferred which will be resolved after login. |
logout() | Logout from the Process Platform server instance. |
Examples
The following are the sample code snippets:
$.cordys.authentication.getUser().done(function(userObject){ var userDN = userObject.userDN; var organizationDN = userObject.organizationDN; var organizationName = userObject.organizationName ; var userName = userDetails.userName }
$.cordys.authentication.login().done(function() { // do your actions })
$.cordys.authentication.logout()